package org.reborn.engine.render.camera

import org.reborn.math._
import javax.media.opengl.{GL,GL2}

import Axis._

class EulerAngleCamera(val axis1:Axis,val axis2:Axis, val axis3:Axis) extends Camera {

  var xRotation = 0.0f;
  var yRotation = 0.0f;
  var zRotation = 0.0f;
  
  def rotation:MatrixF = {
	(rotate(axis3)*rotate(axis2)*rotate(axis1)).transpose
  }
  
  private def rotate(axis:Axis):MatrixF ={
	import MatrixF._
	axis match{
		case X => RotateXMat(xRotation)
		case Y => RotateYMat(yRotation)
		case Z => RotateZMat(zRotation)
		case _ => IdentityMat
	}
  }
}